home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Movie Toolbox / Inside Mac Movie Toolbox Code / mtb7.c < prev    next >
Encoding:
Text File  |  1994-12-05  |  1.1 KB  |  50 lines  |  [TEXT/MPS ]

  1. /*
  2.   File:            mtb7.c
  3.   Contains:        Video Track Functions
  4.   Written by:    DTS and QT Engineering
  5.   Copyright:    © 1992-1994 by Apple Computer, Inc., all rights reserved.
  6.   Change History (most recent first):
  7.   <1>         12/4/94    khs        changed the format of the file to the new look and feel
  8.   To Do:
  9. */
  10.  
  11.  
  12. // INCLUDE FILES
  13. #include "mtb.h"
  14.  
  15.  
  16. // FUNCTIONS
  17. void CreateMyVideoTrack(Movie theMovie)
  18. {
  19.     Track theTrack;
  20.     Media theMedia;
  21.     OSErr err = noErr;
  22.     Rect trackFrame =
  23.     {
  24.         0,  0, 100, 320
  25.     }
  26.     ;
  27.  
  28.     theTrack = NewMovieTrack(theMovie, FixRatio(trackFrame.right, 1), FixRatio(trackFrame.bottom, 1), kNoVolume);
  29.     CheckError(GetMoviesError(), "\pNewMovieTrack");
  30.  
  31.     theMedia = NewTrackMedia(theTrack, VideoMediaType, 600,// Video Time Scale
  32.                              nil, 0);
  33.     CheckError(GetMoviesError(), "\pNewTrackMedia");
  34.  
  35.     err = BeginMediaEdits(theMedia);
  36.     CheckError(err, "\pBeginMediaEdits");
  37.  
  38.     AddVideoSamplesToMedia(theMedia, &trackFrame);
  39.  
  40.     err = EndMediaEdits(theMedia);
  41.     CheckError(err, "\pEndMediaEdits");
  42.  
  43.     err = InsertMediaIntoTrack(theTrack, 0,        // track start time
  44.                                0,                // media start time
  45.                                GetMediaDuration(theMedia), fixed1);
  46.     CheckError(err, "\pInsertMediaIntoTrack");
  47. }
  48.  
  49.  
  50.